/**
 * KopsoxFramework
 * Copyright (C) 2010 Free Software Foundation, Inc. <http://fsf.org/>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.kopsox.util.xml.data.impl;

import java.util.Collection;

import org.kopsox.data.ValueDescriptor;
import org.kopsox.util.xml.data.XMLValueDescriptor;

/**
 * @author Konrad Renner - 23.07.2010
 *
 */
public class XMLValueDescriptorImpl implements XMLValueDescriptor {
	
	private String typeFromValue;
	private String initialValue;
	private ValueDescriptor descriptor;
	private Collection<NamePriorityDescriptor> observers;
	private Collection<NamePriorityDescriptor> validators;

	
	@Override
	public String getTypeFromValue() {
		return this.typeFromValue;
	}

	@Override
	public String getInitialValue() {
		return this.initialValue;
	}

	@Override
	public ValueDescriptor getDescriptor() {
		return this.descriptor;
	}

	@Override
	public Collection<NamePriorityDescriptor> getObservers() {
		return this.observers;
	}

	@Override
	public Collection<NamePriorityDescriptor> getValidators() {
		return this.validators;
	}

	/**
	 * @param typeFromValue the typeFromValue to set
	 */
	public void setTypeFromValue(String typeFromValue) {
		this.typeFromValue = typeFromValue;
	}

	/**
	 * @param initialValue the initialValue to set
	 */
	public void setInitialValue(String initialValue) {
		this.initialValue = initialValue;
	}

	/**
	 * @param descriptor the descriptor to set
	 */
	public void setDescriptor(ValueDescriptor descriptor) {
		this.descriptor = descriptor;
	}

	/**
	 * @param observers the observers to set
	 */
	public void setObservers(Collection<NamePriorityDescriptor> observers) {
		this.observers = observers;
	}

	/**
	 * @param validators the validators to set
	 */
	public void setValidators(Collection<NamePriorityDescriptor> validators) {
		this.validators = validators;
	}
	
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("XMLValueDescriptorImpl[");
		sb.append("descriptor=");
		sb.append(descriptor);
		sb.append(",typeFromValue=");
		sb.append(typeFromValue);
		sb.append(",initialValue=");
		sb.append(initialValue);
		sb.append(",validators=");
		sb.append(validators);
		sb.append(",observers=");
		sb.append(observers);
		sb.append("]");
		
		return sb.toString();
	}
}
